home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Tcl-Tk 8.0 / Pre-installed version / tk8.0 / tests / bell.test < prev    next >
Encoding:
Text File  |  1997-08-15  |  1010 b   |  35 lines  |  [TEXT/ALFA]

  1. # This file is a Tcl script to test out Tk's "bell" command.
  2. # It is organized in the standard fashion for Tcl tests.
  3. #
  4. # Copyright (c) 1994 The Regents of the University of California.
  5. # Copyright (c) 1994-1996 Sun Microsystems, Inc.
  6. #
  7. # See the file "license.terms" for information on usage and redistribution
  8. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  9. #
  10. # SCCS: @(#) bell.test 1.5 96/04/09 23:47:12
  11.  
  12. if {[string compare test [info procs test]] == 1} {
  13.     source defs
  14. }
  15.  
  16. test bell-1.1 {bell command} {
  17.     list [catch {bell a} msg] $msg
  18. } {1 {wrong # args: should be "bell ?-displayof window?"}}
  19. test bell-1.2 {bell command} {
  20.     list [catch {bell a b} msg] $msg
  21. } {1 {bad option "a": must be -displayof}}
  22. test bell-1.3 {bell command} {
  23.     list [catch {bell -displayof gorp} msg] $msg
  24. } {1 {bad window path name "gorp"}}
  25. test bell-1.4 {bell command} {
  26.     puts "Bell should ring now ..."
  27.     flush stdout
  28.     after 500
  29.     bell -displayof .
  30.     after 200
  31.     bell
  32.     after 200
  33.     bell
  34. } {}
  35.